<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" >
<ui:composition template="/WEB-INF/template/basic-template.xhtml">
	<ui:define name="title"><h:outputText value="TESTO"/></ui:define>
	<ui:define  name="content">

		<f:view>
			<h:form id="crudForm">  
  				<p:dataTable var="item" 
  							 id="crudTable" 
  							 value="#{dbexplorerBean.entities}" 
  							 widgetVar="crudTableWidget"
							 styleClass="tabellaElenco"
							 rowKey="#{item.id}">

					<f:facet name="header">
						<ui:remove>
							<div class="headerLista">
								<span class="headerTitle">
									<h:outputText value="#{jmsg.parties_title}"/>
								</span>
								<span class="headerButton">
									<p:commandButton styleClass="pulsante-icon"  actionListener="#{partyBean.doNew}"
													 icon="ui-icon-aggiungi" title="#{jmsg.parties_new}"
													 oncomplete="crudFormDialogWidget.show()" update=":crudFormPanel">
										<p:resetInput target=":crudFormPanel"></p:resetInput>
									</p:commandButton>
									<p:commandButton styleClass="pulsante-icon"  actionListener="#{partyBean.doRicalcola}"
													 rendered="#{sessionBean.userAdmin}"
													 icon="ui-icon-signal-diag" title="Compute Parties Positions"
													 update=":crudFormPanel">
										<p:resetInput target=":crudFormPanel"></p:resetInput>
									</p:commandButton>
								</span>
							</div>
						</ui:remove>
					</f:facet>

				<p:column styleClass="cleft">
					<p:button styleClass="pulsante-icon"  
									 icon="ui-icon-edit" 
									 title="Edit Entity"
									 outcome="form.jsf"
									 >
						<f:param name="id" value="#{item.id}"/>
					</p:button>
				</p:column>
				<p:column styleClass="cleft">
					<h:outputText value="#{item.label}" />
				</p:column>

				</p:dataTable>
			</h:form>
		</f:view>

	</ui:define>
</ui:composition>
</html>
